<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../include/admincontent.jsp" %>
<div id="location">当前位置：系统信息管理 > 系统配置</div>
<div id="Content">
    <form id="Validform" method="post" action="/sysconfig/SaveAction">
        <div class="btnbar">
            <button type="submit" class="save">保 存</button>
        </div>
        <div class="linebar">系统信息</div>
        <table class="treeTable inputform">
            <thead>
            <tr>
                <td width="100">编码</td>
                <td width="150">名称</td>
                <td>内容</td>
            </tr>
            </thead>
            <tbody>${sys}</tbody>
        </table>

        <div class="linebar">短信模板信息</div>
        <table class="treeTable inputform" id="dxtable">
            <thead>
            <tr>
                <td width="100">编码</td>
                <td width="150">名称</td>
                <td>内容</td>
                <td width="20">
                    <button type="button" class="add" onfocus="blur()"></button>
                </td>
            </tr>
            </thead>
            <tbody>${dxmb}</tbody>
        </table>

        <div class="linebar">地址模板信息</div>
        <table class="treeTable inputform" id="dztable">
            <thead>
            <tr>
                <td width="100">编码</td>
                <td width="150">名称</td>
                <td>内容</td>
                <td width="20">
                    <button type="button" class="add" onfocus="blur()"></button>
                </td>
            </tr>
            </thead>
            <tbody>${dzmb}</tbody>
        </table>

        <div class="linebar">邮件发送设置</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="105">邮件服务器</td>
                <td width="150">
                    <div><input type="text" name="host" value="${email.host}" datatype="*" nullmsg="邮件服务器不能为空"/></div>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>邮件地址</td>
                <td>
                    <div><input type="text" name="username" value="${email.username}" datatype="*" nullmsg="邮件地址不能为空"/>
                    </div>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>登录密码</td>
                <td>
                    <div><input type="password" name="password" value="${email.password}" datatype="*"
                                nullmsg="邮箱登录密码不能为空"/></div>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>端口</td>
                <td>
                    <div><input type="text" name="port" value="${email.port}" datatype="*" nullmsg="邮箱端口不能为空"/></div>
                </td>
                <td></td>
            </tr>
            </tbody>
        </table>
        <div class="linebar">短信发送设置</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="105">短信服务器</td>
                <td width="150">
                    <div><input type="text" name="messagehost" value="${message.host}" datatype="*" nullmsg="短信服务器不能为空"/></div>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>短信系统用户名</td>
                <td>
                    <div><input type="text" name="messageusername" value="${message.username}" datatype="*" nullmsg="短信用户名不能为空"/>
                    </div>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>短信系统密码</td>
                <td>
                    <div><input type="password" name="messagepassword" value="${message.password}" datatype="*"
                                nullmsg="短信系统密码不能为空"/></div>
                </td>
                <td></td>
            </tr>
            <%--<tr>
                <td>端口</td>
                <td>
                    <div><input type="text" name="port" value="${email.port}" datatype="*" nullmsg="邮箱端口不能为空"/></div>
                </td>
                <td></td>
            </tr>--%>
            </tbody>
        </table>

        <div class="linebar">简历投递次数设置</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="105">社招投递次数</td>
                <td width="150">
                    <div><input type="text" name="szjlcs" value="${szjlcs}" datatype="*" nullmsg="邮件服务器不能为空"/></div>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>校招投递次数</td>
                <td>
                    <div><input type="text" name="xzjlcs" value="${xzjlcs}" datatype="*" nullmsg="邮件地址不能为空"/>
                    </div>
                </td>
                <td></td>
            </tr>
            <tr>
                <td>是否自动关闭招聘方案</td>
                <td>
                    <div>
                        <%--<input type="text" name="xzjlcs" value="${xzjlcs}" datatype="*" nullmsg="邮件地址不能为空"/>--%>
                        <input type="radio" name="autocloseproject" value="是"  ${autocloseproject=="是"?"checked":""} /> 是
                        <input type="radio" name="autocloseproject"  value="否"  ${autocloseproject=="否"?"checked":""} /> 否
                    </div>
                </td>
                <td></td>
            </tr>
            </tbody>
        </table>

        <div class="linebar">面试注意事项</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="105">注意事项内容</td>
                <td>
                    <div><textarea id="mszysx" name="mszysx" datatype="*" nullmsg="注意事项内容不能为空！"
                                   style="width:99%;height:200px;">${mszysx}</textarea></div>
                </td>
            </tr>
            </tbody>
        </table>
        <div class="linebar">笔试注意事项</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="105">注意事项内容</td>
                <td>
                    <div><textarea id="bszysx" name="bszysx" datatype="*" nullmsg="注意事项内容不能为空！"
                                   style="width:99%;height:200px;">${bszysx}</textarea></div>
                </td>
            </tr>
            </tbody>
        </table>
        <div class="linebar">体检注意事项</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="105">注意事项内容</td>
                <td>
                    <div><textarea id="tjzysx" name="tjzysx" datatype="*" nullmsg="注意事项内容不能为空！"
                                   style="width:99%;height:200px;">${tjzysx}</textarea></div>
                </td>
            </tr>
            </tbody>
        </table>
        <div class="linebar">应聘者注册协议</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="105">协议内容</td>
                <td>
                    <div><textarea id="desc" name="rcont" datatype="*" nullmsg="协议内容不能为空！"
                                   style="width:99%;height:400px;">${tips.rcont}</textarea></div>
                </td>
            </tr>
            </tbody>
        </table>
        <div class="linebar">虚拟目录</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="105">虚拟目录</td>
                <td>
                    <div><input type="text" name="imgpath" value="${imgpath}"/></div>
                </td>
            </tr>
            <tr>
                <td width="105">映射目录</td>
                <td>
                    <div><input type="text" name="mappath" value="${mappath}"/> </div>
                </td>
            </tr>
            </tbody>
        </table>

        <div class="linebar">答题设置</div>
        <table class="treeTable inputform">
            <tbody>
            <tr>
                <td width="105">是否需要答题</td>
                <td>
                    <input type="radio" name="beAnswer" value="是"  ${beAnswer=="是"?"checked":""} /> 是
                    <input type="radio" name="beAnswer"  value="否"  ${beAnswer=="否"?"checked":""} /> 否
                </td>
            </tr>
            </tbody>
        </table>
    </form>

</div>
<script charset="utf-8" src="/resources/js/plugins/kindeditor-4.1.10/kindeditor-min.js"></script>
<script charset="utf-8" src="/resources/js/plugins/kindeditor-4.1.10/lang/zh_CN.js"></script>
<script type="text/javascript">
    //实例化编辑器
    KindEditor.ready(function (K) {
        K.create('#desc', {
            resizeType: 1,
            items: ['source', 'removeformat', 'fullscreen'],
            afterBlur: function () {
                this.sync();
            }
        });
    });

    $(function () {
        document.onkeydown=function()   {
            if (event.ctrlKey === true && event.keyCode === 83) {//Ctrl+S
                event.preventDefault();
                layer.confirm('是否保存表单信息!',{btn: ['保存','取消'] ,//按钮
                    title:'提示'},function () {

                    $("#Validform .save").click();
                    layer.closeAll('dialog');
                },function () {

                });
                 event.returnvalue = false;
                 return false;
            }

        }
    });

    $(function () {
        //添加地址模板
        $('#dztable thead .add').click(function () {
            $('#dztable tbody').append('<tr><td><div><input type="text" datatype="*" nullmsg="编码不能为空"/></div></td><td><div><input type="text" datatype="*" nullmsg="名称不能为空" /></div></td><td><div><input type="text" datatype="*" nullmsg="内容不能为空"/><input type="hidden" value="dzmb"/></div></td><td><button type="button" class="del" onfocus="blur()"></button></td></tr>');
            setNameOrder();
        });

        //添加短信模板
        $('#dxtable thead .add').click(function () {
            $('#dxtable tbody').append('<tr><td><div><input type="text" datatype="*" nullmsg="编码不能为空"/></div></td><td><div><input type="text" datatype="*" nullmsg="名称不能为空"/></div></td><td><div><input type="text" datatype="*" nullmsg="内容不能为空"/><input type="hidden" value="dxmb"/></div></td><td><button type="button" class="del" onfocus="blur()"></button></td></tr>');
            setNameOrder();
        });

        //删除
        $(document).delegate('tbody .del', 'click', function () {
            $(this).parents('tr').remove();
            setNameOrder();
        });
    });

    function setNameOrder() {
        $('tbody tr').each(function (index) {
            $(this).find('td:first input').attr('name', 'config[' + index + '].code');
            $(this).find('td:eq(1) input').attr('name', 'config[' + index + '].name');
            $(this).find('td:eq(2) input[type=text]').attr('name', 'config[' + index + '].cont');
            $(this).find('td:eq(2) input[type=hidden]').attr('name', 'config[' + index + '].groupid');
        });
    }
</script>
</body>
</html>